<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
	<title>관리자관리 - 중앙선거관리위원회 사이버선거역사관</title>
	<script type="text/javascript">
	// 페이지 이동
	function setPage(page)
	{
		var frm = document.forms["listMap"];
		frm.action = "/user/usermng_list.do";
		frm.page.value = page;
		frm.submit();
	}
	
	//삭제하기
	function deleteFileBtn(id)
	{
		if(!checkAuth()) return false;
		if (confirm("정말로 삭제하시겠습니까?"))
	  	{	
			var frm = document.forms["deleteFrm"];
			frm.user_id.value = id;
			frm.submit();
			
			return true;
		}    		
	}
	</script>
</head>

<body>
		<form id="listMap" name="listMap" method="get">
		<input type="hidden" name="page" value="1" />
		<input type="hidden" name="conditions" value="${commandMap.conditions}" />
		<input type="hidden" name="words" value="${commandMap.words}" />
		</form>
		<form name="deleteFrm" method="post" action="../user/usermng_proc.do">
		<input type="hidden" name="mode" value="delete" />
		<input type="hidden" name="user_id"/>
		</form>
		<!-- 본문 영역 -->
		<div id="contents">
			<!-- 제목 및 Location 영역 -->
			<div id="location">
				<h3 id="contentTitle"></h3>
				<div id="locationPath"></div>
			</div>
			<script type="text/javascript">
			// 현재 메뉴 경로를 설정한다.
			var pagePath = licationPth.split("_");
			var pathStr = "홈";
			for( var i=0; i < pagePath.length; i++ )
			{
				if (i+1 >= pagePath.length)
					pathStr += " &gt; <strong>" + pagePath[i] + "</strong>";
				else
					pathStr += " &gt; " + pagePath[i]
			}
			document.getElementById("contentTitle").innerHTML = pagePath[ pagePath.length - 1 ];
			document.getElementById("locationPath").innerHTML = pathStr;
			</script>

			<!-- 본문 내용 -->
			<div id="content">
				<div class="boxType01">
					<form name="searchFrm" emthod="get" action="usermng_list.do">
					<div class="cont ar">
						<select title="검색 조건 선택" name="conditions">
							<option value="user_name">이름</option>
							<option value="user_id">아이디</option>
							<option value="user_tel">전화번호</option>
							<option value="user_group">소속명</option>
							<option value="user_sex">성별</option>
						</select>
						<input type="text" name="words" size="25" value="" />
						<span class="button btnProc04"><input type="submit" value="검색"/></span>
					</div>
					</form>
				</div>
				<table cellpadding="0" cellspacing="0" border="0" class="tbl_type01 mt20">
					<colgroup>
						<col width="80px" />
						<col width="100px" />
						<col width="100px" />
						<col width="100px" />
						<col width="100px" />
						<col width="100px" />
						<col width="80px" />
						<col width="80px" />
						<col />
					</colgroup>
					<thead>
						<tr>
							<th>번호</th>
							<th>이름</th>
							<th>아이디</th>
							<th>이메일</th>
							<th>전화번호</th>
							<th>소속명</th>
							<th>성별</th>
							<th>삭제</th>
						</tr>
					</thead>
					<tbody>
					<c:set var="startno" value="${commandMap.startNo}" />
					<c:forEach items="${listMap}" var="listMap" varStatus="status">
						<tr>
							<td>${status.count}</td>
							<td>${listMap.USER_NAME}</td>
							<td>${listMap.USER_ID}</td>
							<td>${listMap.USER_EMAIL}</td>
							<td>${listMap.USER_TEL}</td>
							<td>${listMap.USER_GROUP}</td>
							<td>
							<c:if test="${listMap.USER_SEX eq 'male'}">남</c:if>
							<c:if test="${listMap.USER_SEX eq 'female'}">여</c:if>
							</td>
							<td><span class="button btnProc01"><a onclick="deleteFileBtn('${listMap.USER_ID}')">삭제</a></span></td>
						</tr>
						<c:set var="startno" value="${startno - 1}" />
					</c:forEach>
					</tbody>
				</table>
				<%@include file="/include/pageList.jsp"%>
			</div>
		</div>
</body>
</html>